#ifndef __ALGSLIB_H__
#define __ALGSLIB_H__

#define MAX_LENGTH 512

typedef struct IntArrayStack
{
    int items[MAX_LENGTH];
    int top;
} intarraystack;

typedef struct IntResizingArrayStack
{
    int *pitems;
    int count;
    int top;
} intresizingstack;

typedef struct IntNode
{
    int item;
    struct IntNode *pnext;
} intnode;

typedef struct IntArrayQueue
{
    int items[MAX_LENGTH];
    int head;
    int rear;
    int count;
} intarrayqueue;

typedef struct IntListStack
{
    intnode *ptop;
    int count;
} intliststack;

typedef struct IntListQueue
{
    intnode *phead;
    intnode *prear;
    int count;
} intlistqueue;

int intpush(int item,intarraystack *pstack);
int intpop(intarraystack *pstack);
int initintarraystack(intarraystack *pstack);

int initintliststack(intliststack *pstack);
int intlistpush(int item, intliststack *pstack);
int intlistpop(intliststack *pstack);

int intarrayenqueue(int item, intarrayqueue *pqueue);
int intarraydequeue(intarrayqueue *pqueue);
int initintarrayqueue(intarrayqueue *pqueue);

int initintlistqueue(intlistqueue *pqueue);
int intlistenqueue(int item, intlistqueue *pqueue);
int intlistdequeue(intlistqueue *pqueue);
#endif
